import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import Vant from "vant";
import "vant/lib/index.css";
import axios from "axios";
import { Lazyload } from "vant";
import { ImagePreview } from "vant";

axios.defaults.baseURL = "http://www.yangjielin.xyz:88/jsonp/get";

Vue.prototype.axios = axios;
Vue.use(Vant);
Vue.use(Lazyload);

let previews = (piclist, type, id) => {
  let pics = piclist.map((val) => {
    return val[type];
  });
  ImagePreview({
    images: pics, //图片列表，数组
    startPosition: parseInt(id), //初始位置
  });
};
Vue.prototype.previews = previews;

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
